package com.situation.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.situation.mapper.TbLogMapper;
import com.situation.pojo.DO.TbLog;
import com.situation.service.TbLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbLogServiceImp implements TbLogService {
    @Autowired
    private TbLogMapper tbLogMapper;

    @Override
    public int addTbLog(TbLog tbLog) {
        return tbLogMapper.addTbLog(tbLog);
    }

    @Override
    public int delete(Long id) {
        return tbLogMapper.delete(id);
    }

    @Override
    public int batchDelete(Long[] ids) {
        return tbLogMapper.batchDelete(ids);
    }

    @Override
    public PageInfo<TbLog> selectByMore(TbLog tbLog,int pageNum,int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<TbLog> tbLogs = tbLogMapper.selectByMore(tbLog);
        return new PageInfo<>(tbLogs);
    }
}
